Skip to content

Remove module-level logging.basicConfig from runtime modules#424

Open
AJaySi wants to merge 1 commit intomainfrom
codex/remove-logging.basicconfig-calls
Open

Remove module-level logging.basicConfig from runtime modules#424
AJaySi wants to merge 1 commit intomainfrom
codex/remove-logging.basicconfig-calls

Conversation

@AJaySi
Copy link
Owner

@AJaySi AJaySi commented Mar 12, 2026

Motivation

  • Prevent modules from configuring global logging handlers at import time to avoid interfering with centralized logging bootstrap in logging_config.py.
  • Ensure modules rely on a consistent logger strategy (either get_service_logger(...) or logging.getLogger(__name__)) rather than reassigning or initializing handlers locally.
  • Reduce surprising side effects during application import and startup caused by logging.basicConfig(...) calls.

Description

  • Removed the module-level logging.basicConfig(...) call from backend/api/linkedin_image_generation.py and retained logger = logging.getLogger(__name__) for local module logging.
  • Removed redundant stdlib logging setup and the loguru import from backend/services/llm_providers/gemini_provider.py and preserved the service-specific logger via logger = get_service_logger("gemini_provider") for a single, consistent logging strategy.
  • Ensured no runtime module performs global handler configuration on import so logging is controlled centrally.

Testing

  • Ran python -m compileall backend/services/llm_providers/gemini_provider.py backend/api/linkedin_image_generation.py and compilation completed successfully.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant